1. Field of the Invention
The invention relates to learn cycles for batteries, such as batteries used in a battery backup unit (BBU) for a data storage system or device. More particularly, the invention relates to methods and devices for improving battery learn cycles in a manner that improves the accuracy of battery capacity readings while managing the data cache policy to avoid system performance degradation.
2. Description of the Related Art
Many data storage systems and devices include a battery backup unit (BBU) that provides reserve power and data integrity in the event that the storage device's main power supply loses power. Typically, the battery backup unit includes one or more rechargeable batteries that are charged by a corresponding power supply. Batteries used for such battery backup units typically are rechargeable batteries of one of a variety types, such as nickel cadmium, nickel metal hydride or lithium ion.
A battery learn cycle is a battery calibration operation performed periodically, e.g., approximately every 3 months, to determine the condition of a battery, such as a rechargeable lithium ion battery included as part of a battery backup unit for a data storage system or device. The battery learn cycle typically is performed by a controller in the device within which the battery resides. The battery learn cycle, which can take from a few hours to up to ten hours, includes the process of discharging and then fully charging the battery. The battery learn cycle also updates the tracked battery parameters (e.g., capacity, voltage, current, temperature and impedance) inside the integrated circuit so that a cache controller can determine whether the battery can maintain the controller cache (i.e., the data written by the cache controller to the cache memory of the device) for a prescribed period of time in the event of a power loss. For example, some batteries are required to maintain the controller cache for 72 hours in the event of AC power loss.
Within many electronic data storage devices, during data read and write operations, the cache controller writes a block of data to cache memory, which is much faster than writing to a physical disk. The cache controller sends an acknowledgement of data transfer completion to the host system. If the controller is using a write-back cache policy, the controller sends a data transfer completion signal to the host when the controller cache has received all the data in a transaction. The cached data is not written to the storage device. The controller then writes the cached data to the storage device when system activity is low or when the write buffer approaches capacity. The risk of using write-back cache is that the cached data can be lost if there is a power failure before the cache data is written to the storage device. While a battery learn cycle is in progress, the battery may not be able to maintain the controller cache during a power loss.
During a battery learn cycle of a battery backup unit, if the controller is using a write-back cache policy, the controller typically changes to a write-through cache policy until the learn cycle completes. In write-through caching, the controller sends a data transfer completion signal to the host system when the disk subsystem has received all the data in a transaction. Write-through cache policy writes the data directly to the disk and reduces the risk that data can be lost in the cache if there is a power loss to the device. However, compared to write-back caching, write-through caching degrades the overall system performance.
Conventional attempts to improve upon the shortcomings of switching from write-back caching to write-through caching during the battery learn cycle of a battery backup unit include increasing the size and capacity of the BBU battery pack to support the load yet still allow the BBU battery to be fully discharged, e.g., an 80% depth of discharge (DOD), to coulomb count the battery charge capacity. However, such oversizing approach unnecessarily increases the volume and cost of the battery backup unit, as well as the time required to perform an 80% DOD battery discharge. Therefore, there still is a need to avoid or prevent the switching of the cache policy from a write-back cache policy to a write-through cache policy during the battery learn cycle for a BBU battery, while still maintaining sufficient battery backup protection to preserve cache data and without degrading the performance of the overall system.